package lesson5;

public class Demo3 {
    public static void main(String[] args) {
        //关系运算符
        boolean result = 20>30;
        //System.out.println(result);


        byte a = 5;   //00000101
        byte b = 6;   //00000110          00000100    00000111    00000011
        System.out.println(a&b);
        System.out.println(a|b);
        //异或两个不一样则为1
        System.out.println(a^b);
        System.out.println(~a); //00000101   //11111010   10000110
        System.out.println(~-6);//

        byte a1 = -5;   //10000101      11111010      11111011
        byte b1 = 6;    //00000110      00000110      00000110          00000010     11111111
        System.out.println(a1&b1);
        System.out.println(a1|b1);





    }
}
